package com.woniuxy.consume;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 简单消费者
 * @RabbitListener：监听指令队列，发现有消息会自动获取到，赋值给方法形参
 */
@Component
public class SimpleConsume {

    @RabbitListener(queues = "simpleQueue")
    public void receive(String msg){
        System.out.println("消费者接受到消息；"+msg);
    }
}
